<template>
  <div>
    <el-container>
      <!-- 头部区域 -->
      <el-header height="76px">
        <h2 v-if="hasRole">专家信息管理</h2>
        <h2 v-else>专家信息查询</h2>
        <!-- 面包屑导航区域 -->
        <el-breadcrumb separator="/">
          <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
          <el-breadcrumb-item v-if="hasRole">医保政策管理</el-breadcrumb-item>
          <el-breadcrumb-item v-else>医保政策查询</el-breadcrumb-item>
        </el-breadcrumb>
      </el-header>
    
    </el-container>
    名称：<el-input v-model="searchForm.nameLike" placeholder=""></el-input>
    <el-button type="primary" @click="queryByCondition">search</el-button>
    <div>{{ results }}</div>
    <el-table :data="results">
      <el-table-column label="xxx" prop="professorName"></el-table-column>
      <el-table-column label="yyy" prop="major"></el-table-column>
    </el-table>
    <el-pagination :total="total" :current-page.sync="searchForm.pageNum" 
    :page-size="searchForm.pageSize" @current-change="queryByCondition" ></el-pagination>
  </div>
</template>
<script>
import request from "../../utils/request";
export default {
  name: "ProfessorManage",
  data() {
    return {
      searchForm: {
        pageNum: 1,
        pageSize: 3,
        order: "",
        nameLike: "",
      },
      results: [],
      total:0
    };
  },
  methods: {
    async queryByCondition() {
      
      console.log("xxxx");
      const res = await request({
        url: "http://localhost:8080/professor/query",
        method: "post",
        data: this.searchForm,
      
      });
      this.results = res.data.list
      this.total = res.data.total
    },
  },
};
</script>

<style lang="less" scoped>
@import "../../style/infoManage.less";
</style>
